package com.wenjiang.controller;

import com.wenjiang.common.annotation.OperatorLog;
import com.wenjiang.common.dto.ChangeRoleParam;
import com.wenjiang.common.lang.Result;
import com.wenjiang.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    RoleService roleService;

    @RequestMapping("/roleInfo")
    public  Object getRole(){
        return  roleService.getRole();
    }

    @RequestMapping("/change")
    @OperatorLog
    public Object change(@RequestBody ChangeRoleParam changeRoleParam){
        Result result = roleService.changRole(changeRoleParam);
        return result;
    }

    @RequestMapping("/detail")
    public  Object getRoleDetail(){
        return roleService.getRoleDetail();
    }



}
